Tolerate unnumbered view results in replay captures - #2255
Closed
erik-krogh wants to merge 2 commits into
Closed
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 44b9b143-294d-4752-966f-f1bb7ddffd6b
Contributor
There was a problem hiding this comment.
Pull request overview
Adds backward-compatible replay matching for legacy numbered view outputs.
Changes:
- Normalizes sequential line prefixes using
view_range. - Applies matching to replies, errors, request-only snapshots, and diagnostics.
- Adds replay and cached-error tests.
Show a summary per file
| File | Description |
|---|---|
test/harness/replayingCapiProxy.ts |
Adds legacy view result comparison. |
test/harness/replayingCapiProxy.test.ts |
Tests numbered-to-unnumbered replay matching. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Balanced
Comment on lines
+878
to
+884
| normalizedMessagesEqual( | ||
| msg, | ||
| conversation.messages[i], | ||
| requestMessages, | ||
| conversation.messages, | ||
| i, | ||
| ), |
Comment on lines
+901
to
+905
| test.each([ | ||
| { | ||
| savedContent: "1. Hello\n2. World\n3.", | ||
| requestContent: "Hello\nWorld", | ||
| arguments: '{"path":"file"}', |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 44b9b143-294d-4752-966f-f1bb7ddffd6b
Author
|
Addressed the automated review feedback:
|
Contributor
There was a problem hiding this comment.
Review details
Suppressed comments (1)
test/harness/replayingCapiProxy.ts:1623
- This can misclassify a current-format result whose file contents are themselves sequentially numbered as a legacy result. For example, a saved current result
1. foo\n2. barwill now match a later resultfoo\nbar, hiding a real file-content change. Please gate legacy stripping on an explicit snapshot/capture format marker (or migrate legacy captures when loading) rather than inferring the format solely from content.
normalizeToolMessageContent(
stripLegacyViewLineNumbers(
savedMessage.content,
viewRangeStart(savedToolCall),
) ?? "",
- Files reviewed: 2/2 changed files
- Comments generated: 0 new
- Review effort level: Balanced
Contributor
|
@erik-krogh Could you clarify why it's better to add this handling than to rewrite the existing captures to the new format? |
Author
|
Closing in favor of #2256, which implements the same transition compatibility with broader edge-case coverage and has a fully green matrix. |
Author
|
Dammit Copilot.... This was Copilot running amok. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The CLI is removing legacy line-number prefixes from
viewtool output in github/copilot-agent-runtime#13802. Existing SDK replay captures still contain numbered results, which makes the C# cross-repository E2E suite cache-miss across every backend.What
viewresult as equivalent to the current unnumbered result.view_rangeso ranged reads remain precise.Testing
cd test/harness && npm testcd test/harness && npx tsc --noEmit -p tsconfig.json